<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ page trimDirectiveWhitespaces="true" %>
<fmt:setLocale value="zh_CN"/>
<%-- 权限判断 --%>
<shield:permssion type="button">
<table class="tab-list shield-table-odd">
	<col width="60">
	<col width="">
	<col width="">
	<col width="115">
    <tr>
        <th>序号</th>
	    <th>备份文件名</th>
	    <th>备份时间</th>
        <th class="operate_icon">操作</th>
    </tr>
  <c:forEach var="model" items="${pageBean.resultList }" varStatus="var">
    <tr>
        <td style="text-align: center;">${(pageBean.currentPage -1)*pageBean.pageSize+var.count }</td>
        
	   	<td title="${model.backupFileName }">${model.backupFileName }</td>
	   	<td title="${model.createTime }" class="shieldDatetime">${model.createTime }</td>
        <td>
        	<!-- href改为data-url -->
            <a class="dbbackupFiledownload" id="${model.id }" title="下载文件"> <img src="${ctxPath}/images/icon/olddownload.png" title="下载文件"> </a>   
	<!-- 屏蔽还原功能，以免还原数据库错乱-->
    <%--        <a data-url="${ctxPathA }/system/dbbackup/torecovery" shieldParams="{'id':'${model.id }'}"  class="shieldDialog  " viewTitle="还原数据库"><img src="${ctxPath}/images/icon/recovery.png" title="还原数据库"> </a>	 --%>    
            <a data-url="${ctxPathA }/system/dbbackup/del" shieldParams="{'id':'${model.id }'}"  class="shieldAjax shield-icon del" viewTitle="确定要删除备份文件吗，删除后无法恢复?"></a>
        </td>
    </tr>
</c:forEach>
<c:if test="${empty pageBean.resultList }">
    <!-- 无数据时展示，有数据时展示上面的列表 -->
    <tr>
        <td colspan="4" class="taCenter">暂无数据</td>
    </tr>
</c:if>
</table>
</shield:permssion>
<script>
$(function(){
	$(".dbbackupFiledownload").click(function(){
		var id =$(this).attr("id");
		if(id){
			  ShieldJS.ajax.post("${ctxPathA }/system/dbbackup/isExitDownFile", {id:$(this).attr("id")}, function(json) {
		    	  window.location="${ctxPathA }/system/dbbackup/downloadAtt?id="+id
	          }, function(json) {
	              ShieldJS.debug("文件不存在！");
	          });
		}else{
			ShieldJS.debug("文件不存在！");
			}
	    
	})
	
});
</script>
<%@include file="/WEB-INF/view/a/include/pagination.jsp"%>
